/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package javaapplication1;

import java.io.Serializable;
import java.util.Collection;
import java.util.Date;
import javax.persistence.*;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;

/**
 *
 * @author jcadavid
 */
@Entity
@Table(name = "nodes", catalog = "qosunacloud", schema = "")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Nodes.findAll", query = "SELECT n FROM Nodes n"),
    @NamedQuery(name = "Nodes.findByUuid", query = "SELECT n FROM Nodes n WHERE n.uuid = :uuid"),
    @NamedQuery(name = "Nodes.findByDate", query = "SELECT n FROM Nodes n WHERE n.date = :date"),
    @NamedQuery(name = "Nodes.findByHostName", query = "SELECT n FROM Nodes n WHERE n.hostName = :hostName"),
    @NamedQuery(name = "Nodes.findByDomainName", query = "SELECT n FROM Nodes n WHERE n.domainName = :domainName"),
    @NamedQuery(name = "Nodes.findByOSName", query = "SELECT n FROM Nodes n WHERE n.oSName = :oSName"),
    @NamedQuery(name = "Nodes.findByOSVersion", query = "SELECT n FROM Nodes n WHERE n.oSVersion = :oSVersion"),
    @NamedQuery(name = "Nodes.findByOSArchitect", query = "SELECT n FROM Nodes n WHERE n.oSArchitect = :oSArchitect"),
    @NamedQuery(name = "Nodes.findByCPUModel", query = "SELECT n FROM Nodes n WHERE n.cPUModel = :cPUModel"),
    @NamedQuery(name = "Nodes.findByCPUVendor", query = "SELECT n FROM Nodes n WHERE n.cPUVendor = :cPUVendor"),
    @NamedQuery(name = "Nodes.findByCPUCores", query = "SELECT n FROM Nodes n WHERE n.cPUCores = :cPUCores"),
    @NamedQuery(name = "Nodes.findByCPUSockets", query = "SELECT n FROM Nodes n WHERE n.cPUSockets = :cPUSockets"),
    @NamedQuery(name = "Nodes.findByCPUMhz", query = "SELECT n FROM Nodes n WHERE n.cPUMhz = :cPUMhz"),
    @NamedQuery(name = "Nodes.findByCPUCoresXSocket", query = "SELECT n FROM Nodes n WHERE n.cPUCoresXSocket = :cPUCoresXSocket"),
    @NamedQuery(name = "Nodes.findByRAMMemorySize", query = "SELECT n FROM Nodes n WHERE n.rAMMemorySize = :rAMMemorySize"),
    @NamedQuery(name = "Nodes.findBySwapMemorySize", query = "SELECT n FROM Nodes n WHERE n.swapMemorySize = :swapMemorySize"),
    @NamedQuery(name = "Nodes.findByHDSpace", query = "SELECT n FROM Nodes n WHERE n.hDSpace = :hDSpace"),
    @NamedQuery(name = "Nodes.findByHDFileSystem", query = "SELECT n FROM Nodes n WHERE n.hDFileSystem = :hDFileSystem"),
    @NamedQuery(name = "Nodes.findByNETMACAddress", query = "SELECT n FROM Nodes n WHERE n.nETMACAddress = :nETMACAddress")})
public class Nodes implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "UUID", nullable = false, length = 50)
    private String uuid;
    @Basic(optional = false)
    @Column(name = "Date", nullable = false)
    @Temporal(TemporalType.TIMESTAMP)
    private Date date;
    @Basic(optional = false)
    @Column(name = "HostName", nullable = false, length = 30)
    private String hostName;
    @Basic(optional = false)
    @Column(name = "DomainName", nullable = false, length = 30)
    private String domainName;
    @Basic(optional = false)
    @Column(name = "OSName", nullable = false, length = 30)
    private String oSName;
    @Basic(optional = false)
    @Column(name = "OSVersion", nullable = false, length = 30)
    private String oSVersion;
    @Basic(optional = false)
    @Column(name = "OSArchitect", nullable = false, length = 30)
    private String oSArchitect;
    @Basic(optional = false)
    @Column(name = "CPUModel", nullable = false, length = 60)
    private String cPUModel;
    @Basic(optional = false)
    @Column(name = "CPUVendor", nullable = false, length = 30)
    private String cPUVendor;
    @Basic(optional = false)
    @Column(name = "CPUCores", nullable = false)
    private int cPUCores;
    @Basic(optional = false)
    @Column(name = "CPUSockets", nullable = false)
    private int cPUSockets;
    @Basic(optional = false)
    @Column(name = "CPUMhz", nullable = false, length = 10)
    private String cPUMhz;
    @Basic(optional = false)
    @Column(name = "CPUCoresXSocket", nullable = false)
    private int cPUCoresXSocket;
    @Basic(optional = false)
    @Column(name = "RAMMemorySize", nullable = false)
    private float rAMMemorySize;
    @Basic(optional = false)
    @Column(name = "SwapMemorySize", nullable = false)
    private float swapMemorySize;
    @Basic(optional = false)
    @Column(name = "HDSpace", nullable = false)
    private float hDSpace;
    @Basic(optional = false)
    @Column(name = "HDFileSystem", nullable = false, length = 30)
    private String hDFileSystem;
    @Basic(optional = false)
    @Column(name = "NETMACAddress", nullable = false, length = 30)
    private String nETMACAddress;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "nodes")
    private Collection<Resourcesmonitoring> resourcesmonitoringCollection;

    public Nodes() {
    }

    public Nodes(String uuid) {
        this.uuid = uuid;
    }

    public Nodes(String uuid, Date date, String hostName, String domainName, String oSName, String oSVersion, String oSArchitect, String cPUModel, String cPUVendor, int cPUCores, int cPUSockets, String cPUMhz, int cPUCoresXSocket, float rAMMemorySize, float swapMemorySize, float hDSpace, String hDFileSystem, String nETMACAddress) {
        this.uuid = uuid;
        this.date = date;
        this.hostName = hostName;
        this.domainName = domainName;
        this.oSName = oSName;
        this.oSVersion = oSVersion;
        this.oSArchitect = oSArchitect;
        this.cPUModel = cPUModel;
        this.cPUVendor = cPUVendor;
        this.cPUCores = cPUCores;
        this.cPUSockets = cPUSockets;
        this.cPUMhz = cPUMhz;
        this.cPUCoresXSocket = cPUCoresXSocket;
        this.rAMMemorySize = rAMMemorySize;
        this.swapMemorySize = swapMemorySize;
        this.hDSpace = hDSpace;
        this.hDFileSystem = hDFileSystem;
        this.nETMACAddress = nETMACAddress;
    }

    public String getUuid() {
        return uuid;
    }

    public void setUuid(String uuid) {
        this.uuid = uuid;
    }

    public Date getDate() {
        return date;
    }

    public void setDate(Date date) {
        this.date = date;
    }

    public String getHostName() {
        return hostName;
    }

    public void setHostName(String hostName) {
        this.hostName = hostName;
    }

    public String getDomainName() {
        return domainName;
    }

    public void setDomainName(String domainName) {
        this.domainName = domainName;
    }

    public String getOSName() {
        return oSName;
    }

    public void setOSName(String oSName) {
        this.oSName = oSName;
    }

    public String getOSVersion() {
        return oSVersion;
    }

    public void setOSVersion(String oSVersion) {
        this.oSVersion = oSVersion;
    }

    public String getOSArchitect() {
        return oSArchitect;
    }

    public void setOSArchitect(String oSArchitect) {
        this.oSArchitect = oSArchitect;
    }

    public String getCPUModel() {
        return cPUModel;
    }

    public void setCPUModel(String cPUModel) {
        this.cPUModel = cPUModel;
    }

    public String getCPUVendor() {
        return cPUVendor;
    }

    public void setCPUVendor(String cPUVendor) {
        this.cPUVendor = cPUVendor;
    }

    public int getCPUCores() {
        return cPUCores;
    }

    public void setCPUCores(int cPUCores) {
        this.cPUCores = cPUCores;
    }

    public int getCPUSockets() {
        return cPUSockets;
    }

    public void setCPUSockets(int cPUSockets) {
        this.cPUSockets = cPUSockets;
    }

    public String getCPUMhz() {
        return cPUMhz;
    }

    public void setCPUMhz(String cPUMhz) {
        this.cPUMhz = cPUMhz;
    }

    public int getCPUCoresXSocket() {
        return cPUCoresXSocket;
    }

    public void setCPUCoresXSocket(int cPUCoresXSocket) {
        this.cPUCoresXSocket = cPUCoresXSocket;
    }

    public float getRAMMemorySize() {
        return rAMMemorySize;
    }

    public void setRAMMemorySize(float rAMMemorySize) {
        this.rAMMemorySize = rAMMemorySize;
    }

    public float getSwapMemorySize() {
        return swapMemorySize;
    }

    public void setSwapMemorySize(float swapMemorySize) {
        this.swapMemorySize = swapMemorySize;
    }

    public float getHDSpace() {
        return hDSpace;
    }

    public void setHDSpace(float hDSpace) {
        this.hDSpace = hDSpace;
    }

    public String getHDFileSystem() {
        return hDFileSystem;
    }

    public void setHDFileSystem(String hDFileSystem) {
        this.hDFileSystem = hDFileSystem;
    }

    public String getNETMACAddress() {
        return nETMACAddress;
    }

    public void setNETMACAddress(String nETMACAddress) {
        this.nETMACAddress = nETMACAddress;
    }

    @XmlTransient
    public Collection<Resourcesmonitoring> getResourcesmonitoringCollection() {
        return resourcesmonitoringCollection;
    }

    public void setResourcesmonitoringCollection(Collection<Resourcesmonitoring> resourcesmonitoringCollection) {
        this.resourcesmonitoringCollection = resourcesmonitoringCollection;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (uuid != null ? uuid.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Nodes)) {
            return false;
        }
        Nodes other = (Nodes) object;
        if ((this.uuid == null && other.uuid != null) || (this.uuid != null && !this.uuid.equals(other.uuid))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "javaapplication1.Nodes[ uuid=" + uuid + " ]";
    }
    
}
